package yz.cp.back.common.enums;

public enum MerchantType {
    NULL("","N/A"),
    F1("F1","资金方"),
    S1("S1","供应商"),
    L1("L1","自营租赁商"),
    L2("L2","入驻租赁商"),
    P1("P1","租赁平台"),
    T1("I1","保险公司");
    private String code;
    private String name;

    MerchantType(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static MerchantType getByCode(String code){
        for (MerchantType item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return MerchantType.NULL;
    }
}
